#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ERROR_CHECK(ret, num, msg) \
    {                              \
        if (ret == num)            \
        {                          \
            perror(msg);           \
            exit(1);               \
        }                          \
    }
int main(int argc, char *argv[])
{

    FILE *fpsrc = fopen(argv[1],"r");
    ERROR_CHECK(NULL,fpsrc,"fopens");
    FILE *fpdest = fopen(argv[2],"w+");
    ERROR_CHECK(NULL,fpdest,"fopend");
    char buf[32] = {0};
    while (NULL != fgets(buf,sizeof(buf),fpsrc))
    {
        fputs(buf,fpdest);
    }
    
    return 0;
}
